package com.zhaoyh.service;

import com.zhaoyh.bean.UserConfig;
import com.zhaoyh.mapper.UserConfigMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 祥霸
 * @date 2019/2/21
 */
@Service
public class UserConfigService {

    @Autowired
    UserConfigMapper userConfigMapper;

    /**
     * 添加用户配置
     * @author 祥霸
     * @date 2019/2/21
     * @parame [uuid]
     * @return java.lang.String
     */
    public String insertByBatch(String uuid) {
        userConfigMapper.insertByBatch(batch(uuid));
        return "success";
    }

    private List<UserConfig> batch(String uuid) {
        List<UserConfig> list = new ArrayList<UserConfig>();
        list.add(new UserConfig("7_tzgz", "1", uuid));
        list.add(new UserConfig("12_tzgz", "1-2-4", uuid));
        list.add(new UserConfig("22_tzgz", "1", uuid));
        list.add(new UserConfig("7_zy", "0.1", uuid));
        list.add(new UserConfig("7_zs", "-15", uuid));
        list.add(new UserConfig("22_zy", "5", uuid));
        list.add(new UserConfig("22_zs", "-15", uuid));
        list.add(new UserConfig("zhmm", "", uuid));
        list.add(new UserConfig("7_sfzsxz", "是", uuid));
        list.add(new UserConfig("12_sfzsxz", "是", uuid));
        list.add(new UserConfig("22_sfzsxz", "是", uuid));

        return list;
    }

}
